<?php
	include "inc/inc_header1.php"; // header
	include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/conn_db.php");
	include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/Utils.php");

	if(isset($_COOKIE["user"])){
		$type = Utils::getUserType($_COOKIE['user']);
		if($type == 1){
			echo "<script language='javascript' type='text/javascript'>";
			echo "window.location.href='/admin.php'";
			echo "</script>";
		}else{
			echo "<script language='javascript' type='text/javascript'>";
			echo "window.location.href='/index01.php'";
			echo "</script>";
		}
	}
?>
</head>
<body class="admin_bd">
    <div id="header">
        <div class="inner">
            <div class="logo"><img src="../img/logo.png"/></div>
        </div>
    </div>
    <div class="wrap">
        <div class="auth-form" id="login">
            <form accept-charset="UTF-8" action="/admin.php" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value=""></div>
                <div class="auth-form-header">
                    <h1>Sign in</h1>
                </div>
                <div class="auth-form-body">
                    <label for="login_field">Username</label>
                    <input autocapitalize="off" autofocus="autofocus" class="input-block" id="login_field" name="username" tabindex="1" type="text">
                    <label for="password">Password</label>
                    <input class="input-block" id="password" name="password" tabindex="2" type="password">
                    <input class="btn btn-info" name="commit" tabindex="3" type="submit" value="Sign in">
                </div>
            </form>
        </div>
    </div>
<?php include "inc/inc_bottom.php" ?><!-- bottom -->
<?php include "inc/inc_footer.php" ?><!-- footer -->
